﻿#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif

#ifndef UDPWIDGET_H
#define UDPWIDGET_H

#include <QWidget>

#include <QUdpSocket> //UDP套接字

namespace Ui {
class UdpWidget;
}

class UdpWidget : public QWidget
{
    Q_OBJECT

public:
    explicit UdpWidget(QWidget *parent = nullptr);
    ~UdpWidget();

private slots:
    void on_btn_send_clicked();

    void on_btn_close_clicked();

    void dealReadInfo();    //槽函数，处理对方发送过来的数据

    void on_btn_setPort_clicked();

private:
    Ui::UdpWidget *ui;

    QUdpSocket *udpSocket;  //UDP套接字

    qint16 portSelf;
};

#endif // UDPWIDGET_H
